/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.diamondsys.embrapa;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Pablo
 */
@Entity
@Table(name = "participante_evento")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ParticipanteEvento.findAll", query = "SELECT p FROM ParticipanteEvento p"),
    @NamedQuery(name = "ParticipanteEvento.findByTbInstCodInstituicao", query = "SELECT p FROM ParticipanteEvento p WHERE p.participanteEventoPK.tbInstCodInstituicao = :tbInstCodInstituicao"),
    @NamedQuery(name = "ParticipanteEvento.findBySigifEventosintIdeventosint", query = "SELECT p FROM ParticipanteEvento p WHERE p.participanteEventoPK.sigifEventosintIdeventosint = :sigifEventosintIdeventosint")})
public class ParticipanteEvento implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ParticipanteEventoPK participanteEventoPK;

    public ParticipanteEvento() {
    }

    public ParticipanteEvento(ParticipanteEventoPK participanteEventoPK) {
        this.participanteEventoPK = participanteEventoPK;
    }

    public ParticipanteEvento(int tbInstCodInstituicao, int sigifEventosintIdeventosint) {
        this.participanteEventoPK = new ParticipanteEventoPK(tbInstCodInstituicao, sigifEventosintIdeventosint);
    }

    public ParticipanteEventoPK getParticipanteEventoPK() {
        return participanteEventoPK;
    }

    public void setParticipanteEventoPK(ParticipanteEventoPK participanteEventoPK) {
        this.participanteEventoPK = participanteEventoPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (participanteEventoPK != null ? participanteEventoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ParticipanteEvento)) {
            return false;
        }
        ParticipanteEvento other = (ParticipanteEvento) object;
        if ((this.participanteEventoPK == null && other.participanteEventoPK != null) || (this.participanteEventoPK != null && !this.participanteEventoPK.equals(other.participanteEventoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.diamondsys.embrapa.ParticipanteEvento[ participanteEventoPK=" + participanteEventoPK + " ]";
    }
    
}
